import 'package:clipboard_watcher/clipboard_watcher.dart';

class ClipboardManager extends ClipboardListener{

  final Function()? clipboardChanged;
  ClipboardManager({required this.clipboardChanged});

  void start(){
    clipboardWatcher.addListener(this);
    clipboardWatcher.start();
  }

  void stop(){
    clipboardWatcher.removeListener(this);
    clipboardWatcher.stop();
  }

  @override
  void onClipboardChanged() {
    super.onClipboardChanged();
    clipboardChanged?.call();
  }
}